/*
Date:20210509 14:18PM
key:删除要将s1全部放到s2，删除s2头，再放回s1.
*/
class CQueue {
public:
        stack<int>s1;
        stack<int>s2;
    CQueue() {

    }
    
    void appendTail(int value) 
    {
        s1.push(value);
    }
    
    int deleteHead() 
    {
        if(s1.empty())
        {
            return -1;
        }
        else
        {
            while(!s1.empty())
            {
                s2.push(s1.top());
                s1.pop();
            }
            int g=s2.top();
            s2.pop();
            while(!s2.empty())
            {
                s1.push(s2.top());
                s2.pop();
            }
            return g;
        }
    }
};

/**
 * Your CQueue object will be instantiated and called as such:
 * CQueue* obj = new CQueue();
 * obj->appendTail(value);
 * int param_2 = obj->deleteHead();
 */